//
//  UISearchController+Ext.m
//  TrainFinder3
//
//  Created by 饶首建 on 17/3/3.
//  Copyright © 2017年 com.ikamobile.trainfinder3. All rights reserved.
//

#import "UISearchController+Ext.h"

@implementation UISearchController (Ext)

+(instancetype)searchVC:(id)target vc:(UIViewController*)vc{
    UISearchController *_searchVC = [[UISearchController alloc]initWithSearchResultsController:vc];
    _searchVC.searchBar.placeholder = @"搜索";
    //    _searchVC.searchBar.barTintColor = [UIColor whiteColor];
    //    [_searchVC.searchBar setBackgroundImage:[UIImage new]];
    _searchVC.searchBar.delegate = target;
    _searchVC.delegate = target;
    _searchVC.searchResultsUpdater = target;
    _searchVC.dimsBackgroundDuringPresentation = YES;
    _searchVC.hidesNavigationBarDuringPresentation = YES;
    _searchVC.searchBar.frame = CGRectMake(0, 0, SWidth(), 44);
    [_searchVC.searchBar sizeToFit];
    return _searchVC;
}

@end
